import {request} from "../base";

export default {
/*
* 菜单
* */
  getMenuList(params) {return request({method: 'GET', url: '/sys/menu/tree', params,})},//左侧所有菜单列表请求
  //getRoleMenuList(params) {return request({method: 'GET', url: '/sys/role-menu/tree', params,})},//根据角色分配的菜单显示菜单列表
  getDeleteMenu(id,params) {return request({method: 'DELETE', url:'/sys/menu/'+id, params,})},//删除菜单
  geteditMenu(params) {return request({method: 'PUT', url: '/sys/menu', params,})},//修改菜单
  getAddMenu(params) {return request({method: 'POST', url: '/sys/menu', params,})},//添加菜单

  /*
  * 用户
  * */
  getUserList(params) {return request({method: 'GET', url: '/sys/user/pageInfo', params,})},//用户列表
  getEditUser(params) {return request({method: 'put', url: '/sys/user/base', params,})},//修改用户信息
  getState(params) {return request({method: 'PATCH ', url: '/sys/user/state', params})},//修改用户状态
  deleteUser(id) {return request({method: 'DELETE', url: '/sys/user/'+id})},//删除用户
  addUser(params) {return request({method: 'POST', url: '/sys/user', params})},
  getUser(id,params) {return request({method: 'GET', url: '/sys/user/'+id, params,})},//获取单个用户信息
  editUserPwd(params) {return request({method: 'PATCH', url: '/sys/user/password', params})},//修改用户密码
  addUserRole(params) {return request({method: 'POST', url: '/sys/user-role/addUserRoles', params})},//给当前用户添加角色
  getUserRoleList(params) {return request({method: 'GET', url: '/sys/user-role/userRolePage', params})},//当前用户的角色
  /*
  * 角色
  * */
  getRoleList() {return request({method:'GET', url: '/sys/role' })},//获取所有角色
  getRole(params) {return request({method:'GET', url:'/sys/role/pageInfo', params})}, //通过page获取角色列表
  addRole(params) {return request({method: 'POST', url: '/sys/role', params})},//新增角色列表
  deleteRole(code) {return request({method:'DELETE', url:'/sys/role/'+code})},//删除角色
  editRole(params) {return request({method:'PUT', url:'/sys/role', params})},//修改角色
  codeRoleSelect(code,params) {return request({method:'GET', url:'/sys/role/'+code, params})},//根据code查询角色
  getRoleAllocation(params) {return request({method:'PUT', url:'/sys/role-jurisdiction/allocation', params})},//角色权限分配
  RoleJurisdiction(params) {return request({method:'GET', url:'/sys/role-jurisdiction/tree', params})},//角色权限树形列表
  RoleMenuJurisdiction(params) {return request({method:'GET', url:'/sys/role-menu/tree', params})},//角色菜单权限树形列表
  RoleMenu(params) {return request({method:'PUT', url:'/sys/role-menu/allocation', params})},//角色菜单分配
  getRoleUser(params) {return request({method:'GET', url:'/sys/user-role/roleUserPage', params})},//角色里的用户分页列表
  deleteRoleUser(params) {return request({method:'DELETE', url:'/sys/user-role/delete', params})},//删除当前角色下的用户


  /*
  * 资源权限
  * */
  getJurisdictionTree() {return request({method:'GET', url:'/sys/jurisdiction/tree'})},//获取权限资源树
  //deleteRoleUser(params) {return request({method:'DELETE', url:'/sys/user-role/delete', params})},//删除当前角色下的用户
  //deleteRoleUser(params) {return request({method:'DELETE', url:'/sys/user-role/delete', params})},//删除当前角色下的用户
  //deleteRoleUser(params) {return request({method:'DELETE', url:'/sys/user-role/delete', params})},//删除当前角色下的用户
  //deleteRoleUser(params) {return request({method:'DELETE', url:'/sys/user-role/delete', params})},//删除当前角色下的用户
  //deleteRoleUser(params) {return request({method:'DELETE', url:'/sys/user-role/delete', params})},//删除当前角色下的用户

}